/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.put.dcs_modeler.fileTypeDataLoader;

import java.io.IOException;
import java.util.logging.Logger;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.UniFileLoader;
import org.openide.util.NbBundle;

public class DCSComputingModelDataLoader extends UniFileLoader
{

    public static final String REQUIRED_MIME = "text/x-dcsComputingModel+xml";
    private static final long serialVersionUID = 1L;
        private static Logger log =
            Logger.getLogger( DCSComputingModelDataLoader.class.getName() );

    public DCSComputingModelDataLoader()
    {
        super( "pl.put.dcs_modeler.fileTypeDataLoader.DCSComputingModelDataObject" );
    }

    @Override
    protected String defaultDisplayName()
    {
        return NbBundle.getMessage( DCSComputingModelDataLoader.class, "LBL_DCSComputingModel_loader_name" );
    }

    @Override
    protected void initialize()
    {
        super.initialize();
        getExtensions().addMimeType( REQUIRED_MIME );
    }

    @Override
    protected MultiDataObject createMultiObject( FileObject primaryFile ) throws DataObjectExistsException, IOException
    {
        log.info( "start");
        return new DCSComputingModelDataObject( primaryFile, this );
    }

    @Override
    protected String actionsContext()
    {
        return "Loaders/" + REQUIRED_MIME + "/Actions";
    }
}
